#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 文件名：06-时间日期.py

import time
ticks = time.time()
print ticks

localtime = time.localtime(ticks)
print "时间元组", localtime

print "格式化时间元"
print time.strftime("%Y-%m-%d %H:%M:%S", localtime)

print time.strftime("%Y-%m-%d %H:%M:%S", localtime)
asctime = time.asctime(localtime)

print "标准时间为", asctime

print "时间元组转成时间戳", time.mktime(localtime)

# 时间休眠
print time.ctime()
time.sleep(5)
print time.ctime()



startTime = time.time()
print "当前时间:{0}".format(startTime)

endTime = time.time()
print "当前时间:{0}".format(endTime)

diffTime = startTime - endTime

print "时间差:{0}".format(diffTime)